const Joi = require('joi');

// 定义登录的验证规则
const phone = Joi.string().pattern(/^1[3-9]\d{9}$/).required()
const password = Joi.string().min(3).max(16).required()
const username = Joi.string().min(1).max(16).required()
const rePassword = Joi.string().min(3).max(16).required()
const authcode = Joi.required()
exports.login_schema = {
    body: {
        phone,
        password
    }
}
exports.register_schema = {
    body: {
        username,
        phone,
        password,
        rePassword,
        authcode
    }
}
exports.authcode_schema = {
    body: {
        phone
    }
}